﻿/// <summary>
/// AssetBundle资源管理器
/// </summary>
public partial class ESF_ABMgr
{
    /// <summary>
    /// 加载模式
    /// </summary>
    public enESF_AbLoadModel loadModel { get; private set; }

    /// <summary>
    /// 更新模式
    /// </summary>
    public enESF_AbUpdateModel updateModel { get; private set; }

    /// <summary>
    /// 是否边玩边下
    /// </summary>
    public bool isDownloadWhilePlaying { get; private set; }

    /// <summary>
    /// 设置模式
    /// </summary>
    /// <param name="_loadModel">加载模式</param>
    /// <param name="_updateModel">更新模式</param>
    public void SetModel(enESF_AbLoadModel _loadModel, enESF_AbUpdateModel _updateModel)
    {
        OnSetUpdateModel(_updateModel);
        OnSetLoadModel(_loadModel);
    }

    /// <summary>
    /// 设置是否边玩边下
    /// </summary>
    /// <param name="_isDownloadWhilePlaying">是否边玩边下</param>
    public void SetDownloadWhilePlaying(bool _isDownloadWhilePlaying)
    {
        isDownloadWhilePlaying = _isDownloadWhilePlaying;
    }


    /// <summary>
    /// 设置 边玩边下的CDN URL
    /// </summary>
    /// <param name="cdnuri"></param>
    public void SetDownLoadUri(string cdnuri)
    {

        SFGlobalSetting.cdnDataPath = cdnuri;
    }

    /// <summary>
    /// 设置模式
    /// </summary>
    /// <param name="_loadModel">加载模式</param>
    public void SetModel(enESF_AbLoadModel _loadModel)
    {
        OnSetLoadModel(_loadModel);
    }

    /// <summary>
    /// 设置模式
    /// </summary>
    /// <param name="_updateModel">更新模式</param>
    public void SetModel(enESF_AbUpdateModel _updateModel)
    {
        OnSetUpdateModel(_updateModel);
    }

    /// <summary>
    /// 设置模式
    /// </summary>
    /// <param name="_loadModel">加载模式</param>
    void OnSetLoadModel(enESF_AbLoadModel _loadModel)
    {
        loadModel = _loadModel;        
    }

    /// <summary>
    /// 设置模式
    /// </summary>
    /// <param name="_updateModel">更新模式</param>
    void OnSetUpdateModel(enESF_AbUpdateModel _updateModel)
    {
        updateModel = _updateModel;
    }
}
